﻿// =====================================================
// Copyright (C) 2016-2020 Fanjia
// All rights reserved
// 机器名称: PC-LIWEI
// 创建时间: 2020/2/14 10:23:34
// 创 建 人: 李伟
// ======================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using log4net;

namespace WindowsFormsApplication1.Common
{
    /// <summary>
    /// 记录日志的类
    /// </summary>
    public static class LogHelper
    {
        public static ILog logError = LogManager.GetLogger("Error");

        public static ILog logInfor = LogManager.GetLogger("InfoLog");

        public static void WriteLog(string infor, Exception ex)
        {
            if (logError.IsErrorEnabled)
            {
                logError.Error(infor, ex);
            }
        }

        public static void WriteLog(string infor)
        {
            if (logInfor.IsInfoEnabled)
            {
                logInfor.Info(infor);
            }
        }
    }
}
